package c.c.k.repository;

import c.c.k.pojo.Event;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;


@Repository
public interface EventRepository extends JpaRepository<Event, Long> {
    Event findByCodeAndAndDate(String code, Date date);

    @Query("select e from Event e where e.stockId in (?1)")
    List<Event> listEvent(List<Long> stockIds, PageRequest request);
}
